package com.rbac.api.service.common;


import com.rbac.api.mybatis.entity.AdminActionLogsEntity;
import com.rbac.api.mybatis.mapper.AdminActionLogsMapper;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

import java.text.MessageFormat;


@Service
public class InsActionLogService {


    ///操作日志mapper
    @Autowired
    private AdminActionLogsMapper adminActionLogsMapper;


    ///记录单条日志
    public void InsOneActionLogService(String actionType,String userNo,String clientIP,String actionContent,Object ... arguments) throws Exception{
        ///记录登录操作
        AdminActionLogsEntity actionLogs = new AdminActionLogsEntity();
        actionLogs.setActionType(actionType);///操作类型
        actionLogs.setActionUserno(userNo);///操作人编号
        actionLogs.setActionClientip(clientIP);///客户端ip
        actionLogs.setActionContent(MessageFormat.format(actionContent,arguments));///操作内容
        adminActionLogsMapper.insertActionLogsSelective(actionLogs);
    }



}
